home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir43
/
med300.zip
/
MEWORD.CLA
< prev
Wrap
Text File
|
1994-02-22
|
3KB
|
69 lines
!▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
!█ █
!█ MEWORD.CLA █
!█ Word-by-word movement █
!█ █
!█ Revision Number: 1 █
!█ Revision Date : 22-Feb-94 █
!█ █
!█ Revision History █
!█ 1 Created █
!█ █
!▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
MEMBER('MEMOEDIT')
!═════════════════════════════════════════════════════════════════════════
! Search for previous word in document
!═════════════════════════════════════════════════════════════════════════
ME_WordLeft FUNCTION( isPosition )
! Locals:
ubChar BYTE ! Character code
CODE
IF isPosition ! If not at first position
isPosition -= 1 ! Adjust position
LOOP WHILE isPosition >= 0 ! Loop
ubChar = ME_GetChar(isPosition) ! Get character code
IF INRANGE(ubChar, 21H, 0FEH) THEN BREAK. ! Break on non-whitespace
isPosition -= 1 ! Decrement position
. ! End if
LOOP WHILE isPosition >= 0 ! Loop
ubChar = ME_GetChar(isPosition) ! Get character code
IF ~INRANGE(ubChar, 21H, 0FEH) THEN BREAK. ! Break on whitespace
isPosition -= 1 ! Decrement position
. ! End loop
isPosition += 1 ! Adjust position
. ! Endif
RETURN(isPosition) ! Return start of prev word
!═════════════════════════════════════════════════════════════════════════
! Search for next word on line
!═════════════════════════════════════════════════════════════════════════
ME_WordRight FUNCTION( isPosition )
! Locals:
ubChar BYTE ! Character code
CODE
LOOP ! Loop
ubChar = ME_GetChar(isPosition) ! Get character code
IF NOT ubChar THEN BREAK. ! Break if past last char
IF ~INRANGE(ubChar, 21H, 0FEH) THEN BREAK. ! Break on whitespace
isPosition += 1 ! Increment position
. ! End if
LOOP ! Loop
ubChar = ME_GetChar(isPosition) ! Get character code
IF NOT ubChar THEN BREAK. ! Break if past last char
IF INRANGE(ubChar, 21H, 0FEH) THEN BREAK. ! Break on non-whitespace
isPosition += 1 ! Increment position
. ! End loop
IF NOT ubChar ! If past last char
isPosition = -1 ! Return invalid position
. ! Endif
RETURN(isPosition) ! Return start of next word